warn about &widget->requisition, even for toplevels.
authorTim Janik <timj@gtk.org>
Wed, 24 Feb 1999 16:29:47 +0000 (16:29 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 24 Feb 1999 16:29:47 +0000 (16:29 +0000)
Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_request): warn about
        &widget->requisition, even for toplevels.

        * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
        automatic variable and check if our size has changed.
        when we decide to reallocate everything, we need to resize our
        own GdkWindow as well.

        * gtk/gtkmain.c:
        * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
        after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.

        * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
        GTK_CHECK_TYPE upon NULL pointers.

        * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
        gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
        gtk_layout_remove_child_cb to shut up compiler.

        * gtk/Makefile.am: added an empty rule
        gtkrc:
                :
        so make doesn't try to "update" gtkrc from gtkrc.c.

14 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/Makefile.am
gtk/gtklayout.c
gtk/gtkmain.c
gtk/gtkobject.c
gtk/gtktypeutils.h
gtk/gtkwidget.c
gtk/gtkwindow.c

index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index f468f976721579c3269a0c2d82602c8df2ffe644..bfda15d2ba0f1c71649222576552dabd32b16728 100644 (file)
@@ -1,3 +1,29 @@
+Wed Feb 24 11:19:12 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): warn about
+       &widget->requisition, even for toplevels.
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): request size into an
+       automatic variable and check if our size has changed.
+       when we decide to reallocate everything, we need to resize our
+       own GdkWindow as well.
+
+       * gtk/gtkmain.c:
+       * gtk/gtkobject.c: hack time, make --gtk-debug=objects work even
+       after gtk_type_init(), this is to "fix" gnome's arg parsing oddities.
+
+       * gtk/gtktypeutils.h: don't segfault in GTK_CHECK_CLASS_TYPE and
+       GTK_CHECK_TYPE upon NULL pointers.
+
+       * gtk/gtklayout.c: removed bogus prototypes of gtk_layout_gravity_works,
+       gtk_layout_set_static_gravity, gtk_layout_add_child_cb and
+       gtk_layout_remove_child_cb to shut up compiler.
+       
+       * gtk/Makefile.am: added an empty rule
+       gtkrc:
+               :
+       so make doesn't try to "update" gtkrc from gtkrc.c.
+
 Wed Feb 24 05:53:15 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * gtk/Makefile.am: removed gtkrc rule added by   
index a17e75d540589daebe445195b2b0cda551333408..e81ee14863c06d1681770485f39f93d19bd72fbd 100644 (file)
@@ -312,8 +312,11 @@ libgtk_la_LDFLAGS = \
 #      $(top_builddir)/gdk/libgdk.la
 
 gtkconfdir = $(sysconfdir)/gtk
-gtkconf_DATA = gtkrc.ja gtkrc.ko gtkrc.ru
+gtkconf_DATA = gtkrc gtkrc.ja gtkrc.ko gtkrc.ru
 
+gtkrc:
+       :
+       
 # We create a dummy theme for the default GTK+ theme
 
 install-data-local:
index 8f4197f65363690221b92a71342c138981f0fcbf..2b55613f2f991a631c0228689cceeb61168adfba 100644 (file)
@@ -103,19 +103,6 @@ static GdkFilterReturn gtk_layout_main_filter (GdkXEvent      *gdk_xevent,
                                               GdkEvent       *event,
                                               gpointer        data);
 
-static gboolean gtk_layout_gravity_works      (void);
-static void     gtk_layout_set_static_gravity (GdkWindow *win,
-                                              gboolean   is_parent,
-                                              gboolean   on);
-
-static void     gtk_layout_add_child_cb    (GdkWindow *parent, 
-                                           GdkWindow *child, 
-                                           gpointer   data);
-static void     gtk_layout_remove_child_cb (GdkWindow *parent, 
-                                           GdkWindow *child, 
-                                           gpointer   data);
-
-
 static GtkWidgetClass *parent_class = NULL;
 static gboolean gravity_works;
 
index 975e13f705654f7509dd348581dceb547fae33f7..08f1e44120b036bc764b9a7fa53a794b1ef33336 100644 (file)
@@ -178,6 +178,7 @@ gboolean
 gtk_init_check (int     *argc,
                char   ***argv)
 {
+  extern void gtk_object_post_arg_parsing_init (void);
   GSList *gtk_modules = NULL;
   GSList *slist;
   gchar *env_string = NULL;
@@ -385,6 +386,7 @@ gtk_init_check (int  *argc,
   gtk_colormap = gdk_colormap_get_system ();
 
   gtk_type_init ();
+  gtk_object_post_arg_parsing_init ();
   gtk_signal_init ();
   gtk_rc_init ();
   
index 1a75dfaa0f5bdbe3856fdfabc5ddd13b8d6db340..2c579606198d428b90035f470d636f94b2a4b866 100644 (file)
@@ -96,6 +96,15 @@ gtk_object_debug (void)
 }
 #endif /* G_ENABLE_DEBUG */
 
+void
+gtk_object_post_arg_parsing_init (void)
+{
+#ifdef G_ENABLE_DEBUG
+  if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
+    g_atexit (gtk_object_debug);
+#endif /* G_ENABLE_DEBUG */
+}
+
 /****************************************************
  * GtkObject type, class and instance initialization
  *
@@ -119,11 +128,6 @@ gtk_object_init_type (void)
 
   object_type = gtk_type_unique (0, &object_info);
   g_assert (object_type == GTK_TYPE_OBJECT);
-
-#ifdef G_ENABLE_DEBUG
-  if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
-    g_atexit (gtk_object_debug);
-#endif /* G_ENABLE_DEBUG */
 }
 
 GtkType
index 1494fa960755ffaf1a0ee458e89523cc0312f01a..3e657b0cb62b9431ddf8f7484d83c32403ca1047 100644 (file)
@@ -107,9 +107,11 @@ typedef enum
 /* Determines whether `type_object' and `type_class' are a type of `otype'.
  */
 #define GTK_CHECK_TYPE(type_object, otype)       ( \
-  gtk_type_is_a (((GtkTypeObject*) (type_object))->klass->type, (otype)) \
+  ((GtkTypeObject*) (type_object)) != NULL && \
+  GTK_CHECK_CLASS_TYPE (((GtkTypeObject*) (type_object))->klass, (otype)) \
 )
 #define GTK_CHECK_CLASS_TYPE(type_class, otype)  ( \
+  ((GtkTypeClass*) (type_class)) != NULL && \
   gtk_type_is_a (((GtkTypeClass*) (type_class))->type, (otype)) \
 )
 
index cbaf6966e04c496e671b3b10f18488b145be34f1..b4a2eacb784c07df5ec813b718c6105b8480dc46 100644 (file)
@@ -2361,7 +2361,7 @@ gtk_widget_size_request (GtkWidget        *widget,
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
 #ifdef G_ENABLE_DEBUG
-  if (!GTK_WIDGET_TOPLEVEL (widget) && (requisition == &widget->requisition))
+  if (requisition == &widget->requisition)
     g_warning ("gtk_widget_size_request() called on child widget with widget equal\n to widget->requisition. gtk_widget_set_usize() may not work properly.");
 #endif /* G_ENABLE_DEBUG */
 
index 20e2c98001828fb0bcdaf5b6ea66711c2d25451d..04ce74819a52b6bbb9e7ca520260aeb7ac72c11f 100644 (file)
@@ -1295,6 +1295,7 @@ gtk_window_move_resize (GtkWindow *window)
 {
   GtkWidget    *widget;
   GtkWindowGeometryInfo *info;
+  GtkRequisition requisition;
   GtkContainer *container;
   gint x, y;
   gint width, height;
@@ -1324,33 +1325,37 @@ gtk_window_move_resize (GtkWindow *window)
   else
     height = widget->requisition.height;
 
-  gtk_widget_size_request (widget, &widget->requisition);
+  size_changed = FALSE;
 
-  /* Figure out the new desired size */
+  gtk_widget_size_request (widget, &requisition);
 
-  size_changed = FALSE;
+  size_changed |= requisition.width != widget->requisition.width;
+  size_changed |= requisition.height != widget->requisition.height;
+  widget->requisition = requisition;
+
+  /* Figure out the new desired size */
 
   if (info && info->width > 0)
     {
-      size_changed = size_changed || (width != info->last_width);
+      size_changed |= width != info->last_width;
       info->last_width = width;
       new_width = info->width;
     }
   else
     {
-      size_changed = size_changed || (width != widget->requisition.width);
+      size_changed |= width != widget->requisition.width;
       new_width = widget->requisition.width;
     }
 
   if (info && info->height > 0)
     {
-      size_changed = size_changed || (height != info->last_height);
+      size_changed |= height != info->last_height;
       info->last_height = height;
       new_height = info->height;
     }
   else
     {
-      size_changed = size_changed || (height != widget->requisition.height);
+      size_changed |= height != widget->requisition.height;
       new_height = widget->requisition.height;
     }
 
@@ -1493,6 +1498,9 @@ gtk_window_move_resize (GtkWindow *window)
       allocation.height = new_height;
       
       gtk_widget_size_allocate (widget, &allocation);
+      gdk_window_resize (widget->window,
+                        new_width,
+                        new_height);
     }
   else
     {